package com.job.Gai_Yian.Homework0716;

import java.security.acl.LastOwnerException;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-16 14:37:37
 */
public class StringBuffer02 {
    public static void main(String[] args) {
        String url="http://localhost:8080/admin/table/tablelist.html";
        StringBuffer sbf=new StringBuffer(url);
        int index=sbf.indexOf("8080");
        String find="8080",port="9000";
        sbf.replace(index,index+find.length(),port);
        url=sbf.toString();
        System.out.println(url);

        int lastIndex=sbf.lastIndexOf("table");
        sbf.delete(lastIndex,lastIndex+5);
        url=sbf.toString();
        System.out.println(url);

        sbf.insert(3,'s');
        url=sbf.toString();
        System.out.println(url);

        String src="24ABVBA42";
        StringBuffer sbf2=new StringBuffer(src);
        String dest=sbf2.reverse().toString();
        if ("src".equals(dest)){
            System.out.println(dest);
        }

    }
}
